package com.feonix.common.permission;

public class PermissionStructure {

	/**
	 * 适配器名称
	 */
	private String adapte;

	/**
	 * 模块根目录
	 */
	private String rootPath;

	/**
	 * 模块id
	 */
	private String moduleId;

	/**
	 * 功能id
	 */
	private String functionId;

	/**
	 * 其他参数
	 */
	private String params;

	/**
	 * 是否允许系统管理员
	 */
	private Boolean allowedAdmin = null;

	/**
	 * 是否允许机构管理员
	 */
	private Boolean allowedGroup = null;

	public void setModuleId(String moduleId) {
		this.moduleId = moduleId;
	}

	public void setFunctionId(String functionId) {
		this.functionId = functionId;
	}

	public String getModuleId() {
		return this.moduleId;
	}

	public String getFunctionId() {
		return this.functionId;
	}

	public Boolean getAllowedAdmin() {
		return this.allowedAdmin;
	}

	public void setAllowedAdmin(Boolean allowedAdmin) {
		this.allowedAdmin = allowedAdmin;
	}

	public Boolean getAllowedGroup() {
		return this.allowedGroup;
	}

	public void setAllowedGroup(Boolean allowedGroup) {
		this.allowedGroup = allowedGroup;
	}

	public String getParams() {
		return this.params;
	}

	public void setParams(String params) {
		this.params = params;
	}

	public String getRootPath() {
		return this.rootPath;
	}

	public void setRootPath(String rootPath) {
		this.rootPath = rootPath;
	}

	public String getAdapte() {
		return this.adapte;
	}

	public void setAdapte(String adapte) {
		this.adapte = adapte;
	}

	public boolean hasRight() {
		AbsPermissionAdapter permissionAdapter = PermissionAdapterHander.getAdapterWithDefault(getAdapte());
		return permissionAdapter.checkTag(this);
	}
}
